<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div style="padding: 5px; background: none repeat scroll 0% 0% rgb(239, 239, 239); text-align: right;">
    <a href="javascript:;" class="easyui-linkbutton" plain="true" id="module-post" icon="icon-save">保存</a>|
    <a href="javascript:;" class="easyui-linkbutton" plain="true" icon="icon-cancel" onclick="$('#window').window('close');">退出</a>
</div>
<div style="text-align: right;">
<form id="ModuleForm" method="POST" action="./index.php?file=sysmodule&action=edit&submit=true">
<input id="id" name="id" value="{$module['id']}" type="hidden">
<table width="100%">
  <tbody><tr>
    <td class="label">模块名称</td>
    <td align="left">
      <input gtbfieldid="7" name="module_name" id="module_name" size="30" value="{$module['text']}" type="text">
    </td>
  </tr>
  <tr>
    <td class="label">上级模块</td>
    <td align="left">
      <select gtbfieldid="8" id="module_id" name="pid" style="width: 218px;"></select>
    </td>
  </tr>
  <tr>
    <td class="label">关联模块</td>
    <td align="left">
      <select gtbfieldid="9" id="relevance_id" name="binid" style="width: 218px;"></select>
    </td>
  </tr>
  <tr>
    <td class="label">执行文件</td>
    <td align="left">
      <input gtbfieldid="10" name="fileName" id="file" size="30" type="text"  value="{$module['file']}">
    </td>
  </tr>
  <tr>
    <td class="label">执行动作</td>
    <td align="left">
      <input gtbfieldid="11" name="actionName" id="action" size="30" type="text"  value="{$module['action']}">
    </td>
  </tr>
  <tr>
    <td class="label">CSS样式(图标)</td>
    <td align="left">
      <input gtbfieldid="12" name="icon" id="module_icon" size="30" value="{$module['icon']}" type="text">
    </td>
  </tr>
  <tr>
    <td class="label">导航显示</td>
    <td align="left">
          <input name="display" value="block"  type="radio" <!--{if $module['display'] == 'block'}-->checked<!--{/if}-->> 显示
      <input name="display" value="none" type="radio" <!--{if $module['display'] == 'none'}-->checked<!--{/if}-->> 隐藏
        </td>
  </tr>
  <tr>
    <td class="label">默认状态</td>
    <td align="left">
          <input name="state" value="open"  type="radio" <!--{if $module['state'] == 'open'}-->checked<!--{/if}-->> 打开
		 <input name="state" value="closed" type="radio" <!--{if $module['state'] == 'closed'}-->checked<!--{/if}-->> 关闭
    </td>
  </tr>
</tbody></table>
<script type="text/javascript">
$('#module_name').focus()
$('#module_id').combotree({
    url:"menu.php?action=moduleTree&__c=${time()}"
});
$('#relevance_id').combotree({
    url:"menu.php?action=moduleTree&__c=${time()}"
});
var module_parent_id = ({$module['pid']})==0?-1:{$module['pid']};
var module_parent_text = (module_parent_id>0) ? "{$module['ptext']}" : "无选择项";
$('#module_id').combotree('setValue',{id:module_parent_id,text:module_parent_text});
var relevance_parent_id = ({$module['binid']}==0)?-1:{$module['binid']};
var relevance_parent_text = (relevance_parent_id>0) ? "{$module['btext']}" : "无选择项";
$('#relevance_id').combotree('setValue',{id:relevance_parent_id,text:relevance_parent_text});
$("#module-post").click(function(){
	$('#ModuleForm').submit();
});
$('#ModuleForm').form({
	success:function(data){
		JSONData = $.evalJSON(data);
    	if(JSONData.status=="error"){
    		$.messager.alert('提示信息', JSONData.msg );
    	}else{
    		window.location.reload();
    	}
	}
});
</script>
</form>
</div>
</body>
</html>